/*
 * @Author: 小巴 2393953821@qq.com
 * @Date: 2024-06-14 08:42:28
 * @LastEditors: 小巴 2393953821@qq.com
 * @LastEditTime: 2024-06-14 14:53:44
 * @FilePath: \vue-elemnt-te\src\main.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import ElSelectTree from 'el-select-tree';
Vue.component('ElSelectTree',ElSelectTree)
import '@/styles/index.scss' // global css

import Navbar from '@/components/Navbar'
Vue.component('Navbars',Navbar)

import App from './App'
import store from './store'
import router from './router'
import getFlag  from '@/utils/plugins'

Vue.use(getFlag)
import '@/icons' // icon
import '@/permission' // permission control


if (process.env.NODE_ENV === 'production') {
  const { mockXHR } = require('../mock')
  mockXHR()
}
Vue.prototype.$handleClickItem = function(){
  this.$nextTick(()=>{
  let domImageMask = document.querySelector(".el-image-viewer__mask");  // 获取遮罩层dom
  if (!domImageMask) {
      return;
  }
  domImageMask.addEventListener("click", () => {
      // 点击遮罩层时调用关闭按钮的 click 事件
      document.querySelector(".el-image-viewer__close").click();
  });
  })
},
// set ElementUI lang to EN
Vue.use(ElementUI)
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
